<?php
// src/Acme/Bundle/UserBundle/Entity/Role.php
namespace Minhsang\SecurityBundle\Entity;

use Symfony\Component\Security\Core\Role\RoleInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="acme_roles")
 * @ORM\Entity()
 */
class Role implements RoleInterface {
	/**
	 * @ORM\Column(name="id", type="integer")
	 * @ORM\Id()
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	private $id;
	/**
	 * @ORM\Column(name="name", type="string", length=30)
	 */
	private $name;
	/**
	 * @ORM\Column(name="role", type="string", length=20, unique=true)
	 */
	private $role;
	/**
	 * @ORM\ManyToMany(targetEntity="User", mappedBy="roles")
	 */
	private $users;
	public function __construct() {
		$this->users = new ArrayCollection ();
	}
	/**
	 *
	 * @see RoleInterface
	 *
	 */
	public function getRole() {
		return $this->role;
	}
}